import { AppInitialState } from './app';

export default (initialState: AppInitialState) => {
  // 在这里按照初始化数据定义项目中的权限，统一管理
  // 参考文档 https://umijs.org/docs/max/access
  const currentUser = initialState.currentUser;
  const permissions = currentUser?.role.permissions;
  const access: any = {};
  permissions?.forEach((permission: any) => {
    access[permission.en] = true;
  });
  console.log('access', access);
  return {
    ...access,
  };
};
